import openai
from packaging import version

required_version = version.parse("1.1.1")
current_version = version.parse(openai.__version__)

if current_version < required_version:
    raise ValueError(f"Error: OpenAI version {openai.__version__}"
                     " is less than the required version 1.1.1")
else:
    print("OpenAI version is compatible.")

# -- Now we can get to it
from openai import OpenAI
client = OpenAI(api_key="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")  # should use env variable OPENAI_API_KEY